﻿using ATM.Model;
using System;
using System.Collections.Generic;

namespace ATM.Components
{
    /// <summary>
    /// Interface to bank.
    /// </summary>
    interface IBank
    {
        /// <summary>
        /// Verifies connection with bank.
        /// </summary>
        /// <returns>true if connection is OK</returns>
        bool VerifyConnection();

        /// <summary>
        /// Verifies credit card with bank.
        /// </summary>
        /// <param name="creditCardInfo">Credit card information to check</param>
        /// <returns>reutrns OK if card was verified successfully, INVALID if card is corrupted or BLOCKED in case card was blocked</returns>
        CreditCardVerificationStatus VerifyCreditCard(CreditCardInfo creditCardInfo);

        /// <summary>
        /// Verifies the PIN code for card in current transaction.
        /// </summary>
        /// <param name="pinCode">PIN code to verify</param>
        /// <returns>OK if PIN was correct or FAILED_CARD_LOCKED if wrong PIN was entered too many times</returns>
        PinCodeVerificationStatus VerifyPinCode(string creditCardNumber, string pinCode);
        
        /// <summary>
        /// Withdraws given amount from credit card's account.
        /// </summary>
        /// <param name="creditCardNumber">Credit card number</param>
        /// <param name="pinCode">Valid PIN code</param>
        /// <param name="amount">Amount to withdraw</param>
        /// <returns>true if amount was withdrawn, false in other cases</returns>
        bool WithdrawAmount(string creditCardNumber, string pinCode, int amount);
    }
}
